<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../jquery-1.12.4.js"></script>
    <script>
        $(function () {
            // 接受一个字符串选择器
            var $box1 = $('.box1');
            var $box2 = $('#box2');
            console.log($box1);
            console.log($box2);
            // 接受一个字符串代码片段
            var $p = $('<p>这是一个段落</p>');
            console.log($p);
            // 接受一个DOM元素
            var span = document.getElementsByTagName('span')[0];
            var $span = $(span);
            console.log($span);
        })
    </script>
</head>

<body>
    <div class="box1"></div>
    <div id="box2"></div>
    <span></span>
</body>

</html>